<template>
  <div>
     <div class="divBox">
      <el-row :gutter="24" class="dashboard-console-grid">
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false">
            <router-link :to="{ path: '/sales/' }">
              <i class="el-icon-goods" style="color: #69c0ff" />
              <p>门店进货</p>
            </router-link>
          </el-card>
        </el-col>
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false">
            <router-link :to="{ path: '/products/' }">
              <i class="el-icon-user" style="color: #95de64" />
              <p>门店销货</p>
            </router-link>
          </el-card>
        </el-col>
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false">
            <router-link :to="{ path: '/purchaseLog/' }">
              <i class="el-icon-s-order" style="color: #ff9c6e" />
              <p>门店进货日志</p>
            </router-link>
          </el-card>
        </el-col>
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false">
            <router-link :to="{ path: '/salesLog/' }">
              <i class="el-icon-s-ticket" style="color: #b37feb" />
              <p>门店销货日志</p>
            </router-link>
          </el-card>
        </el-col>
        <el-col v-bind="grid" class="ivu-mb">
          <el-card :bordered="false">
            <router-link :to="{ path: '/chargeLog/' }">
              <i class="el-icon-postcard" style="color: #ffd666" />
              <p>门店服务费日志</p>
            </router-link>
          </el-card>
        </el-col>
       
      </el-row>
    </div>
    <div class="divBox">
      <el-row
        class="baseInfo"
        :gutter="24"
        justify="center"
        v-for="(count, i) in retailList"
        :key="i"
      >
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>门店电话</span>
              <el-tag type="success">门店</el-tag>
            </div>

            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{ count.phone }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>门店余额</span>
              <el-tag type="success">门店</el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15"
                >{{ count.nowMoney }}元</span
              >
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>向平台进货权限</span>
              <el-tag type="success">门店 </el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
                count.permit == 1 ? "允许" : "不允许"
              }}</span>
              <el-divider></el-divider>
        
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12" >
            <div slot="header" class="acea-row row-between-wrapper">
              <span>积分剩余</span>
              <el-tag type="success">门店 </el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
                count.integral
              }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>店主姓名</span>
              <el-tag type="success">门店</el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
                count.realName
              }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>

     <div class="divBox">
      <el-row
        class="baseInfo"
        :gutter="24"
        justify="center"
        v-for="(count, i) in retailList"
        :key="i"
      >
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>门店名称</span>
              <el-tag type="success">门店</el-tag>
            </div>

            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{ count.name }}</span>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>佣金金额</span>
              <el-tag type="success">门店</el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15"
                >{{ count.brokeragePrice }}元</span
              >
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>充值中心权限</span>
              <el-tag type="success">门店 </el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
                count.isDisable == 0 ? "禁用" : "启用"
              }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12" >
            <div slot="header" class="acea-row row-between-wrapper">
              <span>门店类型</span>
              <el-tag type="success">门店 </el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
                count.retailType == 0 ? "中心店" : "社区店"
              }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
        <el-col :xs="12" :sm="12" class="ivu-mb">
          <el-card :bordered="false" dis-hover :padding="12">
            <div slot="header" class="acea-row row-between-wrapper">
              <span>门店地址</span>
              <el-tag type="success">门店</el-tag>
            </div>
            <div class="content" v-if="count">
              <span class="content-number spBlock mb15">{{
               count.address
              }}</span>
              <el-divider></el-divider>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { queryBalace } from "@/api/yxSystemStore";
export default {
  data() {
    return {
      retailList: [],
      retail: {},
        grid: {
        xl: 3,
        lg: 3,
        md: 6,
        sm: 8,
        xs: 8,
      },
    };
  },
  methods: {
    query() {
      const id = this.retailId;
      queryBalace(id)
        .then((resp) => {
          this.retailList = resp;
         
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
  created() {
    this.retailId = JSON.parse(localStorage.getItem("SET_USER")).retail;
    this.query();
  },
};
</script>

<style scoped lang="scss">
#dividerid {
  margin: 24px 0 8px 0;
}
#span1,
span2 {
  line-height: 24px;
}
#cardid >>> .el-card__body {
  padding: 20px 20px 12px 20px;
}

.panel-group {
  margin-top: 18px;

  .card-panel-col {
    margin-bottom: 32px;
  }

  .card-panel {
    height: 108px;
    cursor: pointer;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);

    .icon-people {
      color: #40c9c6;
    }

    .icon-message {
      color: #36a3f7;
    }

    .icon-money {
      color: #f4516c;
    }

    .icon-shopping {
      color: #34bfa3;
    }

    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }

    .card-panel-icon {
      float: left;
      font-size: 48px;
    }

    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;

      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }

     
    }
  }
}

@media (max-width: 550px) {
  .card-panel-description {
    display: none;
  }

  .card-panel-icon-wrapper {
    float: none !important;
    width: 100%;
    height: 100%;
    margin: 0 !important;

    .svg-icon {
      display: block;
      margin: 14px auto !important;
      float: none !important;
    }
  }
}
.baseInfo {
  /deep/ .el-card__header {
    padding: 15px 20px !important;
  }
}
.ivu-mb {
  width: 20%;
  float: left;
  margin-bottom: 10px;
}
.up,
.el-icon-caret-top {
  color: #f5222d;
  font-size: 12px;
  opacity: 1 !important;
}

.down,
.el-icon-caret-bottom {
  color: #39c15b;
  font-size: 12px;
  /*opacity: 100% !important;*/
}

.content {
  &-number {
    font-size: 20px;
  }
  &-time {
    font-size: 14px;
    /*color: #8C8C8C;*/
  }
}
.spBlock {
  display: block;
}
.panel-group {
  margin-top: 18px;
  .card-panel-col{
    margin-bottom: 32px;
  }
  .card-panel {
    height: 108px;
    font-size: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    color: #666;
    background: #fff;
    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
    border-color: rgba(0, 0, 0, .05);



    .icon-people {
      color: #40c9c6;
    }
    .icon-message {
      color: #36a3f7;
    }
    .icon-money {
      color: #f4516c;
    }
    .icon-shopping {
      color: #34bfa3
    }
    .card-panel-icon-wrapper {
      float: left;
      margin: 14px 0 0 14px;
      padding: 16px;
      transition: all 0.38s ease-out;
      border-radius: 6px;
    }
    .card-panel-icon {
      float: left;
      font-size: 80px;
    }
    .card-panel-description {
      float: right;
      font-weight: bold;
      margin: 26px;
      margin-left: 0px;
      .card-panel-text {
        line-height: 18px;
        color: rgba(0, 0, 0, 0.45);
        font-size: 16px;
        margin-bottom: 12px;
      }
      .card-panel-num {
        font-size: 20px;
      }
    }
  }
}


.ivu-mb {
  margin-bottom: 10px;
}
.divBox {
  // padding: 0 20px !important;
}

.dashboard-console-grid {
  text-align: center;
  .ivu-card-body {
    padding: 0;
  }
  i {
    font-size: 80px;
  }
  a {
    display: block;
    color: inherit;
  }
  p {
    margin-top: 8px;
  }
}
</style>
